package com.xhs.zdl.demo.treeNode;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.unnamed.b.atv.model.TreeNode;
import com.xhs.zdl.demo.R;

/**
 * @author zdl
 * @date 2018/2/8 16:46
 * email zdl328465042@163.com
 * explain
 */

public class MyHolder extends TreeNode.BaseNodeViewHolder<MyHolder.IconTreeItem> {
    public MyHolder(Context context) {
        super(context);
    }

    @Override
    public View createNodeView(TreeNode node, IconTreeItem value) {
        LayoutInflater inflater = LayoutInflater.from(context);
        View view = inflater.inflate(R.layout.item_listview_treenode, null, false);
        TextView treeNodeInfo = view.findViewById(R.id.treeNodeInfo);
        ImageView treeNodeMinus = view.findViewById(R.id.treeNodeMinus);
        ImageView treeNodeAdd = view.findViewById(R.id.treeNodeAdd);

        treeNodeInfo.setText(value.treeNodeInfo);

        return view;
    }

    public static class IconTreeItem{
        public String treeNodeInfo;
        public ImageView treeNodeMinus, treeNodeAdd;
    }
}
